<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
    <body>
        <ui:composition template="../templates/default3.xhtml">        
            <ui:define name="content">
                <h:form id="addProductionSchedule" binding="#{productionScheduleManagerBean.loadAddProductionSchedule_ph}">
                    <p:messages id="error"/>
                    <p:panel header="Production information #{productionScheduleManagerBean.consolidatedMthSalesFcs[0].salesYear}" id="productionSchedule" >
                        <table>                       
                            <tr>
                                <td>
                                    Date PH or Shutdown:
                                </td>
                                <td >
                                    <p:calendar maxdate="#{productionScheduleManagerBean.maxDate}" mindate="#{productionScheduleManagerBean.minDate}" value="#{productionScheduleManagerBean.ph}"  /> 
                                    <p:commandButton id="btnAddDate"   value="Add" actionListener="#{productionScheduleManagerBean.addDate}" ajax="true" update="phs" />
                                    <p:commandButton id="btnRemoveDate"   value="Remove" actionListener="#{productionScheduleManagerBean.removeDate}" ajax="true" update="phs" />
                                </td>
                            </tr>                   
                            <tr>
                                <td>

                                </td>
                                <td>
                                    <h:selectOneListbox id="phs" value="#{productionScheduleManagerBean.selectedPh}" size="8" style="width:200px">
                                        <f:selectItems value="#{productionScheduleManagerBean.phs}"/>    
                                    </h:selectOneListbox>
                                    <f:selectItem itemLabel="Select One" itemValue=""/> 
                                </td>
                            </tr>
                             <tr>
                                <td>
                                    Number of production line:
                                </td>
                                <td >
                                    <p:inputText value="#{productionScheduleManagerBean.line}"></p:inputText>
                                </td>
                            </tr>

                            <tr>
                                <td >

                                </td>
                                <td >
                                    
                                </td>
                            </tr>
                        </table>

                        <br/>
                        <br/>
                        <br/>
                        <hr></hr>

                    <center><p:commandButton id="btnCompute" value="Compute" actionListener="#{productionScheduleManagerBean.computeProductionPlan}" ajax="true" update="error " />
                    </center>
                        
                    </p:panel>

                    <br/>
                    



                </h:form>
            </ui:define>        
        </ui:composition>
    </body>
</html>
